// $Id: filehandler.h 71 2004-11-23 14:36:02Z hansemil $
#ifndef FILEHANDLER_H
#define FILEHANDLER_H

#include <vector>
#include "file.h"
#include "node.h"
using namespace std;

/**
 * FileHandler owns, creates and handles all files that exist (and those which
 * don`t). Nodes uses this class to request and create files.
 */
class FileHandler {
public:
	virtual ~FileHandler();

	static void init(int);
	static File *getFileByIndex(int);
	int getIndexByFile(File *);
	int getFileCount();

	virtual File *getFile(Node *) = 0;
	virtual File *createFile(Node *) = 0;

protected:
	static std::vector<File *> m_files;
};

#endif
